Telegram Group & Telegram Channel
19. Program to Find Harmonic Series.

import java.util.*;

class HarmonicSeries
{

public static void main(String args[])
{

int num, i = 1;
double rst = 0.0;

Scanner in = new Scanner(System.in);
System.out.println("Enter the number for length of series");
num = in.nextInt();

while (i <= num)
{

System.out.print("1/" + i + " +");
rst = rst + (double) 1 / i;

i++;
}

System.out.println("\n\nSum of Harmonic Series is " + rst);
}
}

@java_Codings



tg-me.com/java_codings/28
Create:
Last Update:

19. Program to Find Harmonic Series.

import java.util.*;

class HarmonicSeries
{

public static void main(String args[])
{

int num, i = 1;
double rst = 0.0;

Scanner in = new Scanner(System.in);
System.out.println("Enter the number for length of series");
num = in.nextInt();

while (i <= num)
{

System.out.print("1/" + i + " +");
rst = rst + (double) 1 / i;

i++;
}

System.out.println("\n\nSum of Harmonic Series is " + rst);
}
}

@java_Codings

BY Advance Java πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_codings/28

View MORE
Open in Telegram


Advance Java ‍ Telegram | DID YOU KNOW?

Date: |

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless β€œ$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

Advance Java ‍ from es


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM USA